package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Getter
@Setter
public class HotelProducts {
    private Long id;

    //关联的酒店(需要查酒店的名称 商品名称 商品价格等...)
    private Hotel hotel;
    //关联的用户
    private User user;
    //产品的状态: 1 为购买 2: 购物车  3:已购买
    private Integer prodecutState=2;
    //用户 积分商品的状态   1:已兑换  2:未兑换
    private Integer integralState=2;
    private String integralStateName;
    public String getIntegralStateName(){
        if(integralState==1){
            integralStateName="已兑换";
        }else if(integralState==2){
            integralStateName="兑换";
        }
        return integralStateName;
    }

    //用户的积分
    private Long intergral;
    //用户的购买时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date buyTime;

}